// 用户数据交互
import axios from './axios';
// 注册
function userRegister(data) {
  return axios({
    url: '/user/register1',
    method: 'post',
    data
  })
}
// 登录
const userLogin =(data) => {
  return axios({
    url: '/user/login',
    method: 'post',
    data
  })
}
// 获取地址列表
const userAddr = () => {
  return axios({
    url: '/addrlist',
    method: 'get',
  })
}

// 添加地址
const userAddAddr = (data) => {
  return axios({
    url: '/addaddr',
    method: 'post',
    data
  })
}

// 修改默认地址
const userupdateaddr = (params) => {
  return axios({
    url: '/updateaddr',
    method: 'get',
    params
  })
}
export default {
  userRegister,
  userLogin,
  userAddr,
  userAddAddr,
  userupdateaddr
}